$(document).ready(function() {


    $.ajax({
        url: "/index/getMenu",
        type: 'get',
        async: false,
        success: function (data) {
            var data = data.data;
            if (data != null) {

                var z = 0;//用来转化成数字的中介
                // 导航栏Collections的下拉导航
                var collectionNav_li = "";
                //搜索框左边的分类
                var collectionOpt = "";
                for (var d in data) {
                    collectionNav_li += "<li> <a href=\"collection.html?id=" + data[d].id + "\" class=\"site-nav__link\">" + data[d].name + "</a> </li>";
                    collectionOpt += '<option value="' + data[d].id + '">' + data[d].name + '</option>';
                }
                $("#collectionNav").append(collectionNav_li);
                $("#collection-option").append(collectionOpt);

            }

        }

    });


    // $("a#resource").on('click',()=>{
    //     var url=$("a#resource").text();
    //     if(url!=""&&url!=undefined)
    //     {
    //         url="http://localhost:8084/trace-result?"+url;         //跨越连接          window.location.href = "http://localhost:8084";
    //         // $("a#resource").attr("href",url);
    //         window.location.href =url;
    //     }
    //     else {
    //         prompt("输入不能为空");
    //     }






})
